#!/bin/bash

# 进入relaysvr目录
cd "$(dirname "$0")" || exit 1

# 检查虚拟环境目录是否存在
if [ ! -d "venv" ]; then
    echo "虚拟环境不存在，请先创建虚拟环境"
    exit 1
fi

# 激活虚拟环境
source venv/bin/activate || exit 1

# 使用阿里云源安装依赖
echo "正在使用阿里云源安装依赖..."
pip install -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt --default-timeout=100

# 检查安装结果
if [ $? -eq 0 ]; then
    echo "依赖安装成功！"
else
    echo "依赖安装失败，请检查网络连接或手动安装"
    exit 1
fi